# -*- coding: utf-8 -*-
#  吧一个文件的内容复制粘贴到另一个文件里

txt_path = './far_url.txt'
base_path = './prourl_'

def distribuation():
    f = open(txt_path,'r')
    lines = f.readlines()
    f2 = open(base_path + '1.txt','w')
    content = ''
    for i in range(1,len(lines)):
        if (i % 2000 !=0):
            content += lines[i-1]
        else:
            content +=lines[i-1]
            f2.write(content.strip('\n'))
            block_path = base_path + str(i)+ '.txt'
            f2 = open(block_path,'w')
            content = ''
    content += lines[1]
    print content
    f2.write(content.strip('\n'))
    f2.close()
    f.close()

if __name__ == '__main__':

    distribuation()


